
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module src.psize</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="src.html"><font color="#ffffff">src</font></a>.psize</strong></big></big> (4 June 2008)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/d3y382/workspaces/apbs/pdb2pqr/branches/pdb2pqr-1.7.1a/src/psize.py">/Users/d3y382/workspaces/apbs/pdb2pqr/branches/pdb2pqr-1.7.1a/src/psize.py</a></font></td></tr></table>
    <p><tt>psize&nbsp;class<br>
&nbsp;<br>
Get&nbsp;dimensions&nbsp;and&nbsp;other&nbsp;information&nbsp;from&nbsp;a&nbsp;PQR&nbsp;file.<br>
&nbsp;<br>
Originally&nbsp;written&nbsp;by&nbsp;Dave&nbsp;Sept<br>
Additional&nbsp;APBS-specific&nbsp;features&nbsp;added&nbsp;by&nbsp;Nathan&nbsp;Baker<br>
Ported&nbsp;to&nbsp;Python/<a href="#Psize">Psize</a>&nbsp;class&nbsp;by&nbsp;Todd&nbsp;Dolinsky&nbsp;and&nbsp;subsequently<br>
hacked&nbsp;by&nbsp;Nathan&nbsp;Baker<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;----------------------------<br>
&nbsp;<br>
PDB2PQR&nbsp;--&nbsp;An&nbsp;automated&nbsp;pipeline&nbsp;for&nbsp;the&nbsp;setup,&nbsp;execution,&nbsp;and&nbsp;analysis&nbsp;of<br>
Poisson-Boltzmann&nbsp;electrostatics&nbsp;calculations<br>
&nbsp;<br>
Copyright&nbsp;(c)&nbsp;2002-2011,&nbsp;Jens&nbsp;Erik&nbsp;Nielsen,&nbsp;University&nbsp;College&nbsp;Dublin;&nbsp;<br>
Nathan&nbsp;A.&nbsp;Baker,&nbsp;Battelle&nbsp;Memorial&nbsp;Institute,&nbsp;Developed&nbsp;at&nbsp;the&nbsp;Pacific&nbsp;<br>
Northwest&nbsp;National&nbsp;Laboratory,&nbsp;operated&nbsp;by&nbsp;Battelle&nbsp;Memorial&nbsp;Institute,&nbsp;<br>
Pacific&nbsp;Northwest&nbsp;Division&nbsp;for&nbsp;the&nbsp;U.S.&nbsp;Department&nbsp;Energy.;&nbsp;<br>
Paul&nbsp;Czodrowski&nbsp;&amp;&nbsp;Gerhard&nbsp;Klebe,&nbsp;University&nbsp;of&nbsp;Marburg.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;All&nbsp;rights&nbsp;reserved.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Redistribution&nbsp;and&nbsp;use&nbsp;in&nbsp;source&nbsp;and&nbsp;binary&nbsp;forms,&nbsp;with&nbsp;or&nbsp;without&nbsp;modification,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;permitted&nbsp;provided&nbsp;that&nbsp;the&nbsp;following&nbsp;conditions&nbsp;are&nbsp;met:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Redistributions&nbsp;of&nbsp;source&nbsp;code&nbsp;must&nbsp;retain&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Redistributions&nbsp;in&nbsp;binary&nbsp;form&nbsp;must&nbsp;reproduce&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer&nbsp;in&nbsp;the&nbsp;documentation&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and/or&nbsp;other&nbsp;materials&nbsp;provided&nbsp;with&nbsp;the&nbsp;distribution.<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Neither&nbsp;the&nbsp;names&nbsp;of&nbsp;University&nbsp;College&nbsp;Dublin,&nbsp;Battelle&nbsp;Memorial&nbsp;Institute,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pacific&nbsp;Northwest&nbsp;National&nbsp;Laboratory,&nbsp;US&nbsp;Department&nbsp;of&nbsp;Energy,&nbsp;or&nbsp;University<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;Marburg&nbsp;nor&nbsp;the&nbsp;names&nbsp;of&nbsp;its&nbsp;contributors&nbsp;may&nbsp;be&nbsp;used&nbsp;to&nbsp;endorse&nbsp;or&nbsp;promote<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;products&nbsp;derived&nbsp;from&nbsp;this&nbsp;software&nbsp;without&nbsp;specific&nbsp;prior&nbsp;written&nbsp;permission.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;THIS&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;BY&nbsp;THE&nbsp;COPYRIGHT&nbsp;HOLDERS&nbsp;AND&nbsp;CONTRIBUTORS&nbsp;"AS&nbsp;IS"&nbsp;AND&nbsp;<br>
&nbsp;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nbsp;(INCLUDING&nbsp;NEGLIGENCE&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;OR&nbsp;OTHERWISE)&nbsp;ARISING&nbsp;IN&nbsp;ANY&nbsp;WAY&nbsp;OUT&nbsp;OF&nbsp;THE&nbsp;USE&nbsp;OF&nbsp;THIS&nbsp;SOFTWARE,&nbsp;EVEN&nbsp;IF&nbsp;ADVISED&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;OF&nbsp;THE&nbsp;POSSIBILITY&nbsp;OF&nbsp;SUCH&nbsp;DAMAGE.<br>
&nbsp;<br>
----------------------------</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="getopt.html">getopt</a><br>
</td><td width="25%" valign=top><a href="string.html">string</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="src.psize.html#Psize">Psize</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Psize">class <strong>Psize</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Master&nbsp;class&nbsp;for&nbsp;parsing&nbsp;input&nbsp;files&nbsp;and&nbsp;suggesting&nbsp;settings<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Psize-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getCenter"><strong>getCenter</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getCharge"><strong>getCharge</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getCoarseGridDims"><strong>getCoarseGridDims</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getConstant"><strong>getConstant</strong></a>(self, name)</dt><dd><tt>Get&nbsp;a&nbsp;constant&nbsp;value;&nbsp;raises&nbsp;KeyError&nbsp;if&nbsp;constant&nbsp;not&nbsp;found</tt></dd></dl>

<dl><dt><a name="Psize-getFineGridDims"><strong>getFineGridDims</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getFineGridPoints"><strong>getFineGridPoints</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getFocus"><strong>getFocus</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getLength"><strong>getLength</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getMax"><strong>getMax</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getMin"><strong>getMin</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getProcGrid"><strong>getProcGrid</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-getSmallest"><strong>getSmallest</strong></a>(self)</dt></dl>

<dl><dt><a name="Psize-parseInput"><strong>parseInput</strong></a>(self, filename)</dt><dd><tt>Parse&nbsp;input&nbsp;structure&nbsp;file&nbsp;in&nbsp;PDB&nbsp;or&nbsp;PQR&nbsp;format</tt></dd></dl>

<dl><dt><a name="Psize-parseLines"><strong>parseLines</strong></a>(self, lines)</dt><dd><tt>Parse&nbsp;the&nbsp;lines</tt></dd></dl>

<dl><dt><a name="Psize-parseString"><strong>parseString</strong></a>(self, structure)</dt><dd><tt>Parse&nbsp;the&nbsp;input&nbsp;structure&nbsp;as&nbsp;a&nbsp;string&nbsp;in&nbsp;PDB&nbsp;or&nbsp;PQR&nbsp;format</tt></dd></dl>

<dl><dt><a name="Psize-printResults"><strong>printResults</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;string&nbsp;with&nbsp;the&nbsp;formatted&nbsp;results</tt></dd></dl>

<dl><dt><a name="Psize-runPsize"><strong>runPsize</strong></a>(self, filename)</dt><dd><tt>Parse&nbsp;input&nbsp;PQR&nbsp;file&nbsp;and&nbsp;set&nbsp;parameters</tt></dd></dl>

<dl><dt><a name="Psize-setAll"><strong>setAll</strong></a>(self)</dt><dd><tt>Set&nbsp;up&nbsp;all&nbsp;of&nbsp;the&nbsp;things&nbsp;calculated&nbsp;individually&nbsp;above</tt></dd></dl>

<dl><dt><a name="Psize-setCenter"><strong>setCenter</strong></a>(self, maxlen, minlen)</dt><dd><tt>Compute&nbsp;molecule&nbsp;center</tt></dd></dl>

<dl><dt><a name="Psize-setCoarseGridDims"><strong>setCoarseGridDims</strong></a>(self, olen)</dt><dd><tt>Compute&nbsp;coarse&nbsp;mesh&nbsp;dimensions</tt></dd></dl>

<dl><dt><a name="Psize-setConstant"><strong>setConstant</strong></a>(self, name, value)</dt><dd><tt>Set&nbsp;a&nbsp;constant&nbsp;to&nbsp;a&nbsp;value;&nbsp;returns&nbsp;0&nbsp;if&nbsp;constant&nbsp;not&nbsp;found</tt></dd></dl>

<dl><dt><a name="Psize-setFineGridDims"><strong>setFineGridDims</strong></a>(self, olen, clen)</dt><dd><tt>Compute&nbsp;fine&nbsp;mesh&nbsp;dimensions</tt></dd></dl>

<dl><dt><a name="Psize-setFineGridPoints"><strong>setFineGridPoints</strong></a>(self, flen)</dt><dd><tt>Compute&nbsp;mesh&nbsp;grid&nbsp;points,&nbsp;assuming&nbsp;4&nbsp;levels&nbsp;in&nbsp;MG&nbsp;hierarchy</tt></dd></dl>

<dl><dt><a name="Psize-setFocus"><strong>setFocus</strong></a>(self, flen, np, clen)</dt><dd><tt>Calculate&nbsp;the&nbsp;number&nbsp;of&nbsp;levels&nbsp;of&nbsp;focusing&nbsp;required&nbsp;for&nbsp;each<br>
processor&nbsp;subdomain</tt></dd></dl>

<dl><dt><a name="Psize-setLength"><strong>setLength</strong></a>(self, maxlen, minlen)</dt><dd><tt>Compute&nbsp;molecule&nbsp;dimensions</tt></dd></dl>

<dl><dt><a name="Psize-setProcGrid"><strong>setProcGrid</strong></a>(self, n, nsmall)</dt><dd><tt>Calculate&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;required&nbsp;to&nbsp;span&nbsp;each&nbsp;<br>
dimension</tt></dd></dl>

<dl><dt><a name="Psize-setSmallest"><strong>setSmallest</strong></a>(self, n)</dt><dd><tt>Compute&nbsp;parallel&nbsp;division&nbsp;in&nbsp;case&nbsp;memory&nbsp;requirement&nbsp;above&nbsp;ceiling<br>
Find&nbsp;the&nbsp;smallest&nbsp;dimension&nbsp;and&nbsp;see&nbsp;if&nbsp;the&nbsp;number&nbsp;of&nbsp;grid&nbsp;points&nbsp;in<br>
that&nbsp;dimension&nbsp;will&nbsp;fit&nbsp;below&nbsp;the&nbsp;memory&nbsp;ceiling<br>
Reduce&nbsp;nsmall&nbsp;until&nbsp;an&nbsp;nsmall^3&nbsp;domain&nbsp;will&nbsp;fit&nbsp;into&nbsp;memory</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-log"><strong>log</strong></a>(...)</dt><dd><tt><a href="#-log">log</a>(x[,&nbsp;base])&nbsp;-&gt;&nbsp;the&nbsp;logarithm&nbsp;of&nbsp;x&nbsp;to&nbsp;the&nbsp;given&nbsp;base.<br>
If&nbsp;the&nbsp;base&nbsp;not&nbsp;specified,&nbsp;returns&nbsp;the&nbsp;natural&nbsp;logarithm&nbsp;(base&nbsp;e)&nbsp;of&nbsp;x.</tt></dd></dl>
 <dl><dt><a name="-main"><strong>main</strong></a>()</dt></dl>
 <dl><dt><a name="-usage"><strong>usage</strong></a>(rc)</dt><dd><tt>Print&nbsp;usage&nbsp;information&nbsp;and&nbsp;exit&nbsp;with&nbsp;error&nbsp;code&nbsp;rc</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__author__</strong> = 'Dave Sept, Nathan Baker, Todd Dolinsky, Yong Huang'<br>
<strong>__date__</strong> = '4 June 2008'<br>
<strong>stderr</strong> = &lt;open file '&lt;stderr&gt;', mode 'w' at 0x100416140&gt;<br>
<strong>stdout</strong> = &lt;open file '&lt;stdout&gt;', mode 'w' at 0x1004160b8&gt;</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Dave&nbsp;Sept,&nbsp;Nathan&nbsp;Baker,&nbsp;Todd&nbsp;Dolinsky,&nbsp;Yong&nbsp;Huang</td></tr></table>
</body></html>